package com.dg11185.nearshop.net.request;

import com.dg11185.libs.autoupdate.Version;
import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.app.Constants;
import com.dg11185.nearshop.net.HttpCacheRequest;

public class GetLatestVersionRequest extends HttpCacheRequest<Version> {

    public GetLatestVersionRequest() {
        super(Constants.ADDRESS, Constants.getLatest);
        addParam("platform", "androidPhone");
        addParam("appName", "常惠摇摇");
        addParam("chshToken", Constants.TOKEN);
        addParam("chshSign", MD5Utils.getMD5Str(getParams(), Constants.MD5_key));
    }

    @Override
    protected Version parseJson(String response) throws Exception {
        Version r = new Version();
        r.parseJson(response);
        return r;
    }

}
